package com.flyduck.common.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @program: flyduck-platform
 * @description: 项目配置类
 * @author: flyduck
 * @create: 2021-02-01 22:36
 **/
@Data
@Component
@ConfigurationProperties(prefix = "flyduck")
public class FlyduckConfig {

    // 项目名称
    private String name;

    // 项目版本
    private String version;

    // 验证码配置
    private FlyduckConfig.Code code = new FlyduckConfig.Code();

    // token配置
    private FlyduckConfig.Token token = new FlyduckConfig.Token();

    // Secuity配置
    private FlyduckConfig.Security security = new FlyduckConfig.Security();

    // 验证码配置
    @Data
    public static class Code{

        // 验证码有效期
        private Integer expireTime;

    }

    // token配置
    @Data
    public static class Token{

        // header
        private String header;

        // 令牌有效期
        private Integer expireTime;

    }

    // Secuity配置
    @Data
    public static class Security{
        private List<String> whiteList;
    }

}
